var path = require('path')
var fs = require('fs')

module.exports = {
    title: '前端学习笔记',
    description: '记录学习生涯的各种笔记！',
    base: '/',
    head: [
    //     ['link', { rel: 'icon', href: 'logo.png' }],
    //     ['link', { rel: 'stylesheet', type:'text/css', href: './public/index.css' }]
    ],
    markdown: {
        lineNumbers: true
    },
    smoothScroll: true,
    port: 5000,
    plugins: {
        '@vuepress/medium-zoom': {
            selector: ".theme-note-content img",
            options: {
                margin: 1000,
                background: 'rgba(0,0,0,.4)'
            }
        }
    },
    theme: 'note',
    evergreen: true,
    themeConfig: {
        logo: 'logo.png',
        smoothScroll: true,
        lastUpdated: 'Last Updated',

        // 假定是 GitHub. 同时也可以是一个完整的 GitLab URL
        repo: 'vuejs/vuepress',
        // 自定义仓库链接文字。默认从 `themeConfig.repo` 中自动推断为
        // "GitHub"/"GitLab"/"Bitbucket" 其中之一，或是 "Source"。
        repoLabel: '查看源码',

        // 以下为可选的编辑链接选项

        // 假如文档不是放在仓库的根目录下：
        docsDir: 'note',
        // 假如文档放在一个特定的分支下：
        docsBranch: 'gh-pages',
        // 默认为 "Edit this page"
        editLinkText: '帮助我们改善此页面！',


        displayAllHeaders: true,
        activeHeaderLinks: false,
        nav: [
          {
            text: '首页',
            link: '/'
          },
          {
            text: 'Web',
            ariaLabel: 'Web',
            items: [
              { text: 'CSS', link: '/views/web/css/' },
              { text: 'HTML', link: '/views/web/html/' },
              { text: 'JavaScript', link: '/views/web/javascript/' },
              { text: 'vue', link: '/views/web/vue/' },
            ]
          },
          { text: '笔记', link: '/views/mysql/',
            ariaLabel: 'Web',
            items: [
              { text: '拉钩教育', link: '/views/web/css/' },
              { text: '极客时间', link: '/views/web/html/' }
            ]
          },
          { text: '面试', link: '/views/interview/' },
          { text: '常用', link: '/views/used/' },
          { text: '其他', link: '/views/other/' },
        ],
        sidebar: {
          '/views/algo/': getAlgoSidebar(),
          '/views/web/html/': [],
          '/views/web/css/': [
            {
              title: '什么是BFC',
              collapsable: false,
              sidebarDepth: 2,
              children: [
                '/views/web/css/bfc',
                '/views/web/css/bfc1'
              ]
            }
          ],
          '/views/web/javascript/': [],
          '/views/web/vue/': [],
          '/views/web/emscript/': [],
          '/views/interview/': getInterviewSidebar(),
          '/views/mysql/': getMysqlSidebar(),
          "/views/git/": getGitSidebar(),
          "/views/used/": [
            {
              title: '常用网址',
              collapsable: false,
              sidebarDepth: 0,
              children: [
                ''
              ]
            }
          ]
        }
    },

}


function getAlgoSidebar() {
    return [{
            title: '数据结构和算法',
            collapsable: false,
            sidebarDepth: 0,
            children: [
                '',
                'Complexity'
            ]
        },
        {
            title: '机器学习算法',
            collapsable: false,
            sidebarDepth: 0,
            children: [
                '/views/algo/ai/'
            ]
        }
    ]
}


function getMysqlSidebar() {
    return [{
            title: 'MySQL基础篇',
            collapsable: false,
            sidebarDepth: 0,
            children: [
                '/views/mysql/',
                '/views/mysql/一条SQL更新语句是如何执行的',
                '/views/mysql/Mysql命令',
            ]
        },
        {
            title: 'MySQL实践篇',
            collapsable: false,
            sidebarDepth: 0,
            children: [
                '/views/mysql/practice/',
                '/views/mysql/practice/索引'
            ]
        }
    ]
}

function getJavaSidebar() {
    return [{
        title: 'Java基础',
        collapsable: false,
        sidebarDepth: 0,
        children: [
            ''
        ]
    }]
}
function getInterviewSidebar() {
  return [{
      title: 'CSS相关',
      collapsable: false,
      sidebarDepth: 0,
      children: [
          ''
      ]
    },
    {
      title: '相关',
      collapsable: false,
      sidebarDepth: 0,
      children: [
          ''
      ]
    }
  ]
}

function getGitSidebar() {
  console.log('1111111:::')
    return [{
            title: 'Git基础篇',
            collapsable: false,
            sidebarDepth: 1,
            children: [
                '/views/git/basis/',
                '/views/git/basis/github'
            ]
        },
        {
            title: 'Git高级篇',
            collapsable: false,
            sidebarDepth: 1,
            children: [
                '/views/git/advanced/',
                '/views/git/advanced/advanced'
            ]
        },
    ]
}